﻿package mortal.game.view.mainUI.roleAvatar
{
    import Message.DB.Tables.*;
    import Message.Public.*;
    import mortal.game.resource.tableConfig.*;

    public class BuffData extends Object
    {
        private var _sbuff:SBuff;
        private var _tBuff:TBuff;
        private var _buffId:int;
        private var _group:int;
        public var iconGroupList:Array;

        public function BuffData(param1)
        {
            if (param1 is SBuff)
            {
                this.sbuff = param1;
            }
            else if (param1 is TBuff)
            {
                this.tbuff = param1;
            }
            else if (param1 is int)
            {
                this.tbuff = BuffConfig.instance.getInfoById(param1);
            }
            return;
        }// end function

        public function get sbuff() : SBuff
        {
            return this._sbuff;
        }// end function

        public function set sbuff(param1:SBuff) : void
        {
            this._sbuff = param1;
            this._tBuff = BuffConfig.instance.getInfoById(this._sbuff.buffId);
            return;
        }// end function

        public function get tbuff() : TBuff
        {
            return this._tBuff;
        }// end function

        public function set tbuff(param1:TBuff) : void
        {
            this._tBuff = param1;
            return;
        }// end function

        public function getIconPath() : String
        {
            if (this.tbuff && this.tbuff.icon != 0)
            {
                return this.tbuff.icon + ".jpg";
            }
            return "";
        }// end function

        public function getLeavSeconds() : Number
        {
            var _loc_1:Number = 0;
            if (this._sbuff)
            {
                _loc_1 = this._sbuff.remainSec;
            }
            return _loc_1;
        }// end function

        public function setLeavSeconds(param1:int) : void
        {
            if (this._sbuff)
            {
                this._sbuff.remainSec = param1;
            }
            return;
        }// end function

        public function get buffId() : int
        {
            if (this._tBuff)
            {
                this._buffId = this._tBuff.buffId;
            }
            return this._buffId;
        }// end function

        public function get group() : int
        {
            if (this._tBuff)
            {
                this._group = this._tBuff.group;
            }
            return this._group;
        }// end function

        public function set group(param1:int) : void
        {
            this._group = param1;
            return;
        }// end function

    }
}
